package com.bee2c.platform.web.test.client;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;
import com.bee2c.pub.util.bean.ProcessResult;

@Component
public class BeeOsgiClientFallback implements BeeOsgiClient {

	private final Logger log = LoggerFactory.getLogger(this.getClass());

	@Override
	public ProcessResult client(String bcId, Integer groupId, JSONObject paraJson) {
		log.error("调用OSGI客户端服务异常,由断路器直接返回错误.bcId={},groupId={}", bcId, groupId);
		return ProcessResult.fail("调用OSGI客户端服务异常,由断路器直接返回错误");
	}

	@Override
	public ProcessResult platform(String bcId, JSONObject paraJson) {
		log.error("调用OSGI平台端服务异常,由断路器直接返回错误.bcId={}", bcId);
		return ProcessResult.fail("调用OSGI平台端服务异常,由断路器直接返回错误");
	}
}
